<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>28.使用访问器批量设置属性</title>
</head>
<body>
  <script>
    
    const web = {
      name: '后盾人',
      url: 'houdunren.com',
      set site(value){
        [this.name,this.url] = value.split(',');
      },
      get site() {
        return `name: ${this.name},url: ${this.url}`
      }
    };

    web.site = "开源产品,www.hdcms.com";
    console.log(web.site);
  </script>
</body>
</html>